package com.cn.distributor.controller;


import com.cn.common.result.Result;
import com.cn.distributor.entity.Enterprise;
import com.cn.distributor.entity.Personal;
import com.cn.distributor.service.AuditingService;
import com.cn.distributor.vo.DistributorIdVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.xml.soap.Text;

@RestController
@Api(tags = "分销商审核")
@RequestMapping("/back/auditing")
public class AuditingController {

    @Autowired
            private AuditingService auditingService;
    @GetMapping("/findEnterprise")
    @ApiOperation("查看所有商家用户审核")
    public Result findEnterprise(Enterprise enterprise, int limit, int page){
        return auditingService.findEnterprise(enterprise) ;
    }
    @GetMapping("/findPersonal")
    @ApiOperation("查看所有个人用户审核")

    public Result findPersonal(Personal personal, int limit, int page){
        return auditingService.findPersonal(personal);
    }
    @ApiOperation("审核通过")
    @PostMapping("/auditSuccessful")
    public Result auditSuccessful(DistributorIdVo distributorIdVo){
         return auditingService.auditSuccessful(distributorIdVo);

    }
    @ApiOperation("驳回审核")
    @PostMapping("/rejectionReview")
    public Result rejectionReview(DistributorIdVo distributorIdVo, Text text){
        return auditingService.rejectionReview(distributorIdVo,text);
    }

}
